package com.gpl.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gpl.mapper.FenceMapper;
import com.gpl.domain.Fence;
import com.gpl.service.IFenceService;

/**
 * 电子围栏Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-05-25
 */
@Service
public class FenceServiceImpl implements IFenceService 
{
    @Autowired
    private FenceMapper fenceMapper;

    /**
     * 查询电子围栏
     * 
     * @param fid 电子围栏主键
     * @return 电子围栏
     */
    @Override
    public Fence selectFenceByFid(Long fid)
    {
        return fenceMapper.selectFenceByFid(fid);
    }

    /**
     * 查询电子围栏列表
     * 
     * @param fence 电子围栏
     * @return 电子围栏
     */
    @Override
    public List<Fence> selectFenceList(Fence fence)
    {
        return fenceMapper.selectFenceList(fence);
    }

    /**
     * 新增电子围栏
     * 
     * @param fence 电子围栏
     * @return 结果
     */
    @Override
    public int insertFence(Fence fence)
    {
        return fenceMapper.insertFence(fence);
    }

    /**
     * 修改电子围栏
     * 
     * @param fence 电子围栏
     * @return 结果
     */
    @Override
    public int updateFence(Fence fence)
    {
        return fenceMapper.updateFence(fence);
    }

    /**
     * 批量删除电子围栏
     * 
     * @param fids 需要删除的电子围栏主键
     * @return 结果
     */
    @Override
    public int deleteFenceByFids(Long[] fids)
    {
        return fenceMapper.deleteFenceByFids(fids);
    }

    /**
     * 删除电子围栏信息
     * 
     * @param fid 电子围栏主键
     * @return 结果
     */
    @Override
    public int deleteFenceByFid(Long fid)
    {
        return fenceMapper.deleteFenceByFid(fid);
    }

    @Override
    public void add(Long fid, String address) {
        fenceMapper.add(fid,address);
    }
}
